<!-- summary 额外属性
  除了ElementPlus的属性外，其他的功能属性一律添加在 quickAttrs 中
-->
<template>
  <BaseForm :fields="fields" :fetch="PostMockCommon"></BaseForm>
</template>
<script lang="ts" setup>
import { FormFieldAttrs } from "@/components/form/_components/FieldItem/_config";
import { PostMockCommon } from "@/api-mock";

const fields: FormFieldAttrs[] = [
  {
    tpl: "T_Phone",
    prop: "cellphone",
    label: "电话",
    required: true,
    quickAttrs: {
      explain: `required: true属性，需要另外设置，不在valid: "phone" 规则内`,
      tips: '通过设置valid:"phone"，则获得了电话号码正则长度等校验规则',
    },
  },
  {
    tpl: "T_Password",
    prop: "password",
    label: "密码",
    quickAttrs: {
      explain: "设置tips，在底部获得注：的能力",
      example: "abc123456",
      tips: "设置example属性，则自动拼接到placeholder后面",
    },
  },
  {
    tpl: "T_Age",
    prop: "age",
    label: "年龄",
    quickAttrs: {
      explain: "设置explain属性，获得explain弹出层能力",
    },
  },
];
</script>
<style lang="scss" scoped></style>
